let banner = new Swiper('.banner', {
	speed:1500,
	autoplay: {
		delay: 20000,
		disableOnInteraction: false,
	},
	loop: true,
	observer:true,
	observeParents:true,
	observeSlideChildren:true,
	effect : 'fade',
	
})
let banner1 = new Swiper('.banner1', {
	speed:800,	
	autoplay: {
		delay: 800,
		disableOnInteraction: false,
	},
	loop: true,
	observer:true,
	observeParents:true,
	observeSlideChildren:true,
	pagination: {
		el: '.swiper-pagination',
		clickable :true,
	},
	
})
let banner2 = new Swiper('.banner2', {
	speed:200,	
	// autoplay: {
	// 	delay: 800,
	// 	disableOnInteraction: false,
	// },
	loop: true,
	observer:true,
	observeParents:true,
	observeSlideChildren:true,
	pagination: {
		el: '.swiper-pagination',
		clickable :true,
	},
	navigation: {
		nextEl: '.banner-next',
		prevEl: '.banner-prev',
	},
	
	methods:{
	//前进后退按钮的显示与隐藏
	mouseOver(){
		this.show=true;
	},
	mouseOut(){
		this.show=false;
	  }
	}
})
$('.p4_bottom_L_bottom>img').click(function(){
	banner2.slideTo($(this).index()+1, 1000, false);//切换到第一个slide，速度为1秒
  })
let banner3 = new Swiper('.banner3', {
	speed:1500,	
	autoplay: {
		delay: 1200,
		disableOnInteraction: false,
	},
	loop: true,
	observer:true,
	observeParents:true,
	observeSlideChildren:true,
	pagination: {
		el: '.swiper-pagination',
		clickable :true,
	},
	navigation: {
		nextEl: '.banner-next3',
		prevEl: '.banner-prev3',
	},
	
})

let flag = true;
setInterval(function(){
	if(flag){
		$('.dong').css("transform","scale(1.3)");
	}else{
		$('.dong').css("transform","scale(1)");
	}
	flag = !flag
},800)

var item = document.querySelectorAll('.tab .item>li');
var content = document.querySelectorAll('.tab .content>div');

for(var i=0; i<item.length; i++){
	
	item[i].setAttribute('suoyin', i);
	
	item[i].onclick = function(){
		
		var suoyin = this.getAttribute('suoyin');
		
		for(var j=0; j<item.length; j++){
			item[j].classList.remove('active');
			content[j].classList.remove('show');
		}
		this.classList.add('active');
		content[suoyin].classList.add('show');
	}
}
$('.xinwen_box_R .item1>li').click(function(){
	$(this).addClass('active1').siblings().removeClass('active1');
	$('.content1>div').eq($(this).index()).addClass('show1').siblings().removeClass('show1');
})
$('.p3_bottum .item2>li').click(function(){
	$(this).addClass('active2').siblings().removeClass('active2');
	$('.content2>li').eq($(this).index()).addClass('show2').siblings().removeClass('show2');
})
$('.p5_bottom .item3>div').click(function(){
	$(this).addClass('active3').siblings().removeClass('active3');
	$('.content3>div').eq($(this).index()).addClass('show3').siblings().removeClass('show3');
})
$(".item3>div").click(function(){
	$(this).addClass('active3').parent().find().siblings().removeClass('active3');
})

var sp2 = document.querySelector(".sp2");
var cha = document.querySelector(".cha");
var mv1_mm = document.querySelector(".mv1_mm");

sp2.onclick =function(){
	mv1_mm.style.display = "block";
}
cha.onclick =function(){
	mv1_mm.style.display = "none";
	player.pause();
	player.currentTime = 0;
}

let audio = document.getElementById('mu_player');
let duration = 0;

function getDuration(audioObj){
	return audioObj.duration;
}
function formatTime(time){
	
	let min = parseInt(time / 60);
	let sec = Math.floor(time - (min * 60));
	sec = sec >= 10? sec : '0'+sec;
	min = min >= 10? min : '0'+min;
	
	return {'sec': sec, 'min': min}
}
// audio.oncanplay = function(){
// 	duration = getDuration(audio);
// 	dura.innerHTML = formatTime(duration).min+':'+formatTime(duration).sec;
// }

let yaoling = document.querySelectorAll(".p4_bottom_L_bottom img");
